# Dockerfile
# docker build -t my-v2board:latest .
FROM php:8.2-cli-alpine3.20

RUN apk add --no-cache \
    libpng-dev \
    libjpeg-dev \
    libzip-dev \
    zip \
    git \
    wget
# 安装编译依赖
RUN docker-php-ext-configure gd --with-jpeg && \
    docker-php-ext-install -j$(nproc) \
    gd mysqli pdo_mysql zip opcache bcmath ctype dom xml tokenizer json session openssl phar iconv curl

# 安装 Redis 扩展
RUN pecl install redis && docker-php-ext-enable redis

WORKDIR /home/v2board

# 复制 V2Board 源码
COPY v2board-master/ .

# 暴露端口
EXPOSE 8080

# 启动脚本
RUN chmod +x /init.sh

# 默认启动命令
CMD ["/bin/sh", "init.sh"]